
# 在原始标签文件每行前加一个序号

import os

label_path = "E:\Works\Hisi_codes\SLRDataset_isolate\labels_101.txt"  # 原标签文件
label_path2 = "E:\Works\Hisi_codes\SLRDataset_isolate\labels_1012.txt"# 保存文件

try:
    label_file = open(label_path, 'r')
    label_file2 = open(label_path2, 'w')
    count = 0
    for line in label_file.readlines():

        label_file2.writelines("{:03d}\t".format(count) + line)
        count = count + 1
except Exception as e:
    raise

